package com.example.event_resource_java.commons.exce;

import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;

@Data
@AllArgsConstructor //LomBok中生成有参构造方法
@NoArgsConstructor //LomBok中生成无参构造方法
public class JinZhiException extends RuntimeException{


    @ApiModelProperty(value = "状态码")
    private int code;//状态码
    private String msg;//异常信息

    @Autowired
    public String toString() {
        return "JnZhiException{" +
                "message=" + this.msg +
                ", code=" + code +
                '}';
    }
}
